package com.dj.product.k2faas.jpa.view;

import com.dj.product.k2faas.jpa.dto.QueryArg;
import org.springframework.data.domain.Page;

import java.util.List;
import java.util.Optional;

/**
 * Created by 丁建 on 2025/9/23 09:49
 *
 * @author 丁建
 */
public interface CommonView {

    int update(String sqlTemplate, QueryArg queryArg);

    <T> Page<T> findAllByPage(String sqlTemplate, QueryArg queryArg, Class<T> tClass);

    <T> T findOne(String sqlTemplate, QueryArg queryArg, Class<T> tClass, String errorMessage);

    <T> Optional<T> tryFindOne(String sqlTemplate, QueryArg queryArg, Class<T> tClass);

    <T> T findOne(String sqlTemplate, QueryArg queryArg, Class<T> tClass);

    <T> List<T> findAll(String sqlTemplate, QueryArg queryArg, Class<T> tClass);
}
